package springstudy.service;

import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Service;

import java.util.stream.Stream;

/**
 * @Author acy
 * @Date 2019/04/24
 */
@Profile("java8")
@Service
public class Java8CalculateService implements CalculateService{
	@Override
	public Integer sum(Integer... values) {
		System.out.println("使用的java8方式");
		Integer sum = Stream.of(values).reduce(0, Integer::sum);
		return sum;
	}
}
